import { BaseResult, BaseScrollPageListResult } from '@/common/base/base.result';
import { ApiProperty } from '@nestjs/swagger';
import { EvaluationIndexResult } from '../evaluation/evaluation.result';
import { BooleanNumber } from 'common/utils/data';

class EQResultFilters {
  @ApiProperty()
  filterType: string;

  @ApiProperty()
  frequency: number;

  @ApiProperty()
  q: number;

  @ApiProperty()
  gain: number;
}

class EQResultEvaluationBrand {
  @ApiProperty()
  title: string;
}


class EQResultEvaluation {
  @ApiProperty()
  title: string;

  @ApiProperty()
  brand: EQResultEvaluationBrand;
}

export class EQResult extends BaseScrollPageListResult {
  @ApiProperty()
  evaluationUuid: string;

  @ApiProperty()
  evaluation: EQResultEvaluation;

  @ApiProperty()
  dataGroup: string;

  @ApiProperty()
  name: string;

  @ApiProperty()
  audioFiles: string[];

  @ApiProperty({
    type: [EQResultFilters],
  })
  filters: EQResultFilters[];

  @ApiProperty()
  createTime: number;

  @ApiProperty()
  updateTime: number;

  @ApiProperty()
  open: BooleanNumber;

  @ApiProperty()
  desc: string;
}

export class EQOpenShowResultUser extends BaseResult{
  @ApiProperty()
  avatar: string;

  @ApiProperty()
  name: string;

  @ApiProperty()
  titleCertification: string;

  @ApiProperty()
  signature: string;
}
export class EQOpenResult extends EQResult {
  @ApiProperty()
  user: EQOpenShowResultUser;
}

export class EQShowResult extends EQResult {
  @ApiProperty({
    type: [Number],
    isArray: true,
  })
  points: number[][];
}

export class EQOpenShowResult extends EQShowResult {
  @ApiProperty()
  user: EQOpenShowResultUser;
}

class EQTop10ResultHitEvaluationData{
  @ApiProperty()
  name: string;

  @ApiProperty()
  distance: number;

  @ApiProperty()
  dataGroup: string;
}

export class EQTop10Result extends EvaluationIndexResult {
  @ApiProperty()
  hitEvaluationData: EQTop10ResultHitEvaluationData;
}

export class EQGetFiltersByTempEQResult {
  @ApiProperty({
    type: [EQResultFilters],
  })
  filters: EQResultFilters[];
}

export class EQGetFiltersBySegmentFreqResult {
  @ApiProperty({
    type: [EQResultFilters],
  })
  filters: EQResultFilters[];
}
